import request from '@/utils/request'

// 立案信息管理
export function getFilingList(fling) {
  return request({
    url: '/api/flow/filings',
    method: 'GET',
    params: fling
  })
}

export function getFilingListByParentIdAndDayBetween(params) {
  return request({
    url: '/api/flow/filings/getByParentId',
    method: 'GET',
    params
  })
}

export function createFiling(fling) {
  return request({
    url: '/api/flow/filings',
    method: 'POST',
    data: fling
  })
}

export function updateFiling(fling) {
  return request({
    url: '/api/flow/filings/' + fling.id,
    method: 'PUT',
    data: fling
  })
}

export function deleteFiling(id) {
  return request({
    url: '/api/flow/filings/' + id,
    method: 'DELETE'
  })
}

export function getFilingAlertList(params) {
  return request({
    url: '/api/flow/filing/alerts',
    method: 'GET',
    params
  })
}

export function getFilingPeriodStats(params) {
  return request({
    url: '/api/flow/filing/stats/period',
    method: 'GET',
    params
  })
}

export function getFilingAmountOverview(params) {
  return request({
    url: '/api/flow/filing/stats/amount/overview',
    method: 'GET',
    params
  })
}

export function getFilingAmountOverviewGroupByOrg(params) {
  return request({
    url: '/api/flow/filing/stats/amount/overviewGroupByOrg',
    method: 'GET',
    params
  })
}

export function getFilingAmountGroupByOrg() {
  return request({
    url: '/api/flow/filing/stats/amount/groupByOrg',
    method: 'GET'
  })
}

export function getFilingAmountTrend() {
  return request({
    url: '/api/flow/filing/stats/amount/trend',
    method: 'GET'
  })
}

export function getFilingAlertBrief() {
  return request({
    url: '/api/flow/filing/alerts/brief',
    method: 'GET'
  })
}
